{% extends "../main.html" %}
{% block head_js %}
<link href="{{static_url('datatable/jquery.dataTables.css')}}" rel="stylesheet">
<!--link href="http://cdn.datatables.net/1.10.0/css/jquery.dataTables.css" rel="stylesheet"-->

{% end %}
{% block nem %}
<ul class="nav nav-sidebar">
    <li><a href="/users">用户管理</a></li>
    <li class=""><a href="/users/add">添加用户</a></li>
    <li class="active"><a href="/users_group">组管理</a></li>
</ul>

{% end %}
{% block bodyy %}
<h3 class="sub-header" content="">用户组列表</h3>
<form class="form-horizontal" method="post">
    <table>
        <tr>
            <td>
                <input type="text" class="form-control" placeholder="组名称" name="groupname">
            </td>
            <td>
                <button class="btn btn-primary" type="submit" name="cmd" value="add">添加组</button>
                <!--<button class="btn btn-primary" type="reset" name="cmd" value="reset">重置组</button>-->
            </td>
        </tr>
    </table>
</form>

<h2 class="sub-header"></h2>
<table id="hosts" class="table table-striped">
    <thead>
    <tr>
        <th>ID</th>
        <th>组名称</th>
        <th>操作</th>
    </tr>
    </thead>
    <tbody>
    {% for i in data %}
    <tr>
        <td>{{i[0]}}</td>
        <td>{{i[1]}}</td>
        <td>
            <!--button type="submit" class="btn btn-primary" name="id" value={{i[0]}}>编辑</button>
                 <button type="submit" class="btn btn-danger" name="delete" value="{{i}}">删除</button-->
            <a href="/users_group/update?id={{i[0]}}">
                <button type="button" class="btn btn-primary btn-xs">编辑</button>
            </a>
            <a href="/delete/users_role/{{i[0]}}">
                <button type="button" class="btn  btn-danger btn-xs">删除</button>
            </a>
        </td>

    </tr>
    {% end %}

    </tbody>
</table>


{% end %}
{% block body_js %}
<script src="{{ static_url('datatable/jquery.dataTables.min.js') }}"></script>
<script type="text/javascript">
    $(document).ready(function () {
        $('#hosts').dataTable({
            "language": {
                "url": "{{ static_url('datatable/Chinese.json') }}"
            }
        });
    });
</script>
{% end %}
